package jmine.tec.services.test.services;

import java.util.concurrent.TimeUnit;

import jmine.tec.services.annotations.Execution;
import jmine.tec.services.annotations.ServiceImplementor;
import jmine.tec.services.annotations.WithRegex;
import jmine.tec.services.api.ActionsEnum;
import jmine.tec.utils.Tuple;
import junit.framework.Assert;

@ServiceImplementor(action = ActionsEnum.INCLUIR)
public class WithRegexService extends Assert {

    @Execution
    public void execute(@WithRegex(regex = "unit: (.+)", groupIndex = 1) Tuple<TimeUnit, String> tuple) {
        assertNotNull(tuple);
        assertEquals(TimeUnit.SECONDS, tuple.head());
        assertNotNull(tuple.tail());
    }

}
